home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / Half-Life Model Viewer / src / FileAssociation.h < prev    next >
C/C++ Source or Header  |  1999-05-04  |  2KB  |  91 lines

  1. //
  2. //                 Half-Life Model Viewer (c) 1999 by Mete Ciragan
  3. //
  4. // file:           FileAssociation.h
  5. // last modified:  Apr 28 1999, Mete Ciragan
  6. // copyright:      The programs and associated files contained in this
  7. //                 distribution were developed by Mete Ciragan. The programs
  8. //                 are not in the public domain, but they are freely
  9. //                 distributable without licensing fees. These programs are
  10. //                 provided without guarantee or warrantee expressed or
  11. //                 implied.
  12. //
  13. // version:        1.2
  14. //
  15. // email:          mete@swissquake.ch
  16. // web:            http://www.swissquake.ch/chumbalum-soft/
  17. //
  18. #ifndef INCLUDED_FILEASSOCIATION
  19. #define INCLUDED_FILEASSOCIATION
  20.  
  21.  
  22.  
  23. #ifndef INCLUDED_MXWINDOW
  24. #include <mx/mxWindow.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #define IDC_EXTENSION            1001
  30. #define IDC_ADD                    1002
  31. #define IDC_REMOVE                1003
  32. #define IDC_ACTION1                1004
  33. #define IDC_ACTION2                1005
  34. #define IDC_ACTION3                1006
  35. #define IDC_ACTION4                1007
  36. #define IDC_PROGRAM                1008
  37. #define IDC_CHOOSEPROGRAM        1009
  38. #define IDC_OK                    1010
  39. #define IDC_CANCEL                1011
  40.  
  41.  
  42.  
  43. typedef struct
  44. {
  45.     char extension[16];
  46.     char program[256];
  47.     int association;
  48. } association_t;
  49.  
  50.  
  51.  
  52.  
  53. class mxChoice;
  54. class mxRadioButton;
  55. class mxLineEdit;
  56. class mxButton;
  57.  
  58.  
  59.  
  60. class FileAssociation : public mxWindow
  61. {
  62.     mxChoice *cExtension;
  63.     mxRadioButton *rbAction[4];
  64.     mxLineEdit *leProgram;
  65.     mxButton *bChooseProgram;
  66.     association_t d_associations[16];
  67.  
  68.     void initAssociations ();
  69.     void saveAssociations ();
  70.  
  71. public:
  72.     // CREATORS
  73.     FileAssociation ();
  74.     virtual ~FileAssociation ();
  75.  
  76.     // MANIPULATORS
  77.     int handleEvent (mxEvent *event);
  78.     void setAssociation (int index);
  79.  
  80.     // ACCESSORS
  81.     int getMode (char *extension);
  82.     char *getProgram (char *extension);
  83. };
  84.  
  85.  
  86.  
  87. extern FileAssociation *g_FileAssociation;
  88.  
  89.  
  90.  
  91. #endif // INCLUDED_FILEASSOCIATION